<{include file="admin:common/header.html"}>
<div class="page-title">
    <table width="100%" align="center" cellpadding="0" cellspacing="0" >
      <tr>
        <td width="30" align="right"><img src="<{$pager.url}>/images/main-h5-ico.gif" alt="" /></td>
        <th><{$MOD.title}></th>
        <td align="right"><{link ctl="weixin/weixin:index" priv="hidden" class="button"}></td>
        <td width="15"></td>
      </tr>
    </table>
</div>
<div class="page-data">
<form action="?weixin/weixin-edit.html" mini-form="weixin-form" method="post" ENCTYPE="multipart/form-data">
<input type="hidden" name="wx_id" value="<{$detail.wx_id}>"/>
<table width="100%" border="0" cellspacing="0" class="table-data form">
<tr><th>公众号名称：</th><td><input type="text" name="data[wx_name]" value="<{$detail.wx_name|default:''}>" class="input w-300"/></td></tr>
<tr><th class="w-100"><span class="red">*</span>城市：</th><td><{widget id="data/region" city_id=$detail.city_id level=2}></td></tr>
<tr>
    <th><span class="red">*</span>微信原始ID：</th>
    <td><input type="text" name="data[wx_sid]" value="<{$detail.wx_sid|default:''}>" class="input w-200"/><span class="tip-comment">微信公众号的原始ID</span></td>
</tr>
<tr><th>微信号：</th><td><input type="text" name="data[weixin]" value="<{$detail.weixin|default:''}>" class="input w-200"/></td></tr>
<tr>
    <th>公众号类型：</th>
    <td>
        <label><input type="radio" name="data[type]" <{if empty($detail.type)}>checked="checked"<{/if}> value="0"/>订阅号</label>
        <label><input type="radio" name="data[type]" <{if $detail.type}>checked="checked"<{/if}> value="1"/>服务号</label>&nbsp;&nbsp;       
    </td>
</tr>
<tr><th>头像：</th>
    <td>
        <{if $detail.face}><img src="<{$pager.img}>/<{$detail.face}>" photo="<{$pager.img}>/<{$detail.face}>" class="wh-100"/><br /><{/if}>
        <input type="file" name="weixin_face" class="input w-200"/>        
    </td>
</tr>
<tr>
    <th>AppID：</th>
    <td><input type="text" name="data[appid]" value="<{$detail.appid|default:''}>" class="input w-300"/><span class="tip-comment">AppID(应用ID)</span></td>
</tr>
<tr>
    <th>AppSecret：</th>
    <td><input type="text" name="data[secret]" value="<{$detail.secret|default:''}>" class="input w-300"/><span class="tip-comment">AppSecret(应用密钥)</span></td>
</tr>
<tr><th class="clear-th-bottom"></th><td class="clear-td-bottom" colspan="10"><input type="submit" class="bt-big" value="提交数据" /></td></tr>
</table>
</form></div>
<script type="text/javascript">
(function(K, $){
$("select[name='data[city_id]']").live('change', function(){
	var city_id = $(this).val();
	if(!city_id){return false;}
	$.getJSON("?data/area-city-"+city_id+".html", function(ret){
		if(ret.error){
			Widget.MsgBox.error(ret.message.join(","));
		}else if(ret.areas.length>0){
			var html = "";
			for(var i=0; i<ret.areas.length; i++){
				html += '<option value="'+ret.areas[i].area_id+'">'+ret.areas[i].area_name+'</option>';
			}
			$("select[name='data[area_id]']").html(html);		
		}else{
			$("select[name='data[area_id]']").html('<option value="">--</option>');
		}
	});
});
})(window.KT, window.jQuery);
</script>
<{include file="admin:common/footer.html"}>